.SUFFIXES: .o .cpp

CXX        = g++
CPPFLAGS   = -g -O -Wall #-DDEBUG

INCLUDEDIR = -I../include

OBJECT  := hte_gramma.o hte_scanner.o hte_main.o hte_parser.o hte_operator.o hte_stack.o
OUTPUT  := nsl.exe

all: $(OUTPUT)

.cpp.o:
	$(CXX) $(CPPFLAGS) $(INCLUDEDIR) -c $^

.c.o:
	$(CXX) $(CPPFLAGS) $(INCLUDEDIR) -c $^

$(OUTPUT): $(OBJECT)
	g++ -o $@ $^

hte_gramma.c: hte_gramma.y
	C:\hunter\bin\UnxUtils\usr\local\bison\bison_call.bat hte_gramma.c $^ C:\hunter\bin\UnxUtils\usr\local\bison\

hte_scanner.c: hte_scanner.l
	flex -ohte_scanner.c -i $^ 

clean:
	del *.o hte_scanner.c hte_gramma.c $(OUTPUT) *.exe hte_gramma.h
